package com.example.demo.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * @author 又菜又爱浪
 * @date 2021-12-20
 * 执行信息实体
 */
public class ExecuteInformationEntity implements Serializable {

    private static final long serialVersionUID = Objects.hashCode(ExecuteInformationEntity.class);

    /**
     * 主键，自增
     */
    private Long id;

    /**
     * 数据库表名
     */
    private String tableName;
    /**
     * 对象表的主键
     */
    private String primaryKey;
    /**
     * 每次处理的最大的条数
     */
    private Integer maxSize;
    /**
     * 间隔的时间，单位为loopType
     */
    private Integer loopInterval;
    /**
     * 循环的单位，年，月，日，时
     * {@link com.example.demo.typeEnums.LoopType}
     */
    private String loopType;
    /**
     * 开始执行时间
     */
    private Date startTime;
    /**
     * 执行类型，删除或者归档
     * {@link com.example.demo.typeEnums.ExecuteType}
     */
    private String executeType;
    /**
     * 归档时数据的保存方式，保存到同一张表或者保存到新表
     * {@link com.example.demo.typeEnums.ArchiveType}
     */
    private String archiveType;
    /**
     * 保留的数量
     */
    private Integer reserveSize;
    /**
     * 保留的类型
     * {@link com.example.demo.typeEnums.ReservedType}
     */
    private String reserveType;
    /**
     * 保留依据的字段
     */
    private String reserveColumn;
    /**
     * 全部数量-保留数量大于满足删除条件的数量时，依靠该字段来判断先删除那些数据，
     */
    private String sortColumn;
    /**
     * sortColumn的类型，升序或降序
     * {@link com.example.demo.typeEnums.SortType}
     */
    private String sortType;
    /**
     * 备份表数据处理方式(主表数据发生改变时，备份表需要重新生成)
     * {@link com.example.demo.executor.backupDeal.BackupDealEnum}
     */
    private String backupDealType;
    /**
     * 状态；1：执行中，2：执行结束，3：已取消
     */
    private Integer status;
    /**
     * 执行条件
     */
    private ExecuteConditionEntity executeCondition;
    /**
     * 关联的处理
     */
    private List<RelatedExecuteInformationEntity> relatedExecuteInformation;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(String primaryKey) {
        this.primaryKey = primaryKey;
    }

    public Integer getMaxSize() {
        return maxSize;
    }

    public void setMaxSize(Integer maxSize) {
        this.maxSize = maxSize;
    }

    public Integer getLoopInterval() {
        return loopInterval;
    }

    public void setLoopInterval(Integer loopInterval) {
        this.loopInterval = loopInterval;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public String getExecuteType() {
        return executeType;
    }

    public void setExecuteType(String executeType) {
        this.executeType = executeType;
    }

    public String getArchiveType() {
        return archiveType;
    }

    public void setArchiveType(String archiveType) {
        this.archiveType = archiveType;
    }

    public String getReserveType() {
        return reserveType;
    }

    public void setReserveType(String reserveType) {
        this.reserveType = reserveType;
    }

    public String getReserveColumn() {
        return reserveColumn;
    }

    public void setReserveColumn(String reserveColumn) {
        this.reserveColumn = reserveColumn;
    }

    public String getSortColumn() {
        return sortColumn;
    }

    public void setSortColumn(String sortColumn) {
        this.sortColumn = sortColumn;
    }

    public String getSortType() {
        return sortType;
    }

    public void setSortType(String sortType) {
        this.sortType = sortType;
    }

    public ExecuteConditionEntity getExecuteCondition() {
        return executeCondition;
    }

    public void setExecuteCondition(ExecuteConditionEntity executeCondition) {
        this.executeCondition = executeCondition;
    }

    public List<RelatedExecuteInformationEntity> getRelatedExecuteInformation() {
        return relatedExecuteInformation;
    }

    public void setRelatedExecuteInformation(List<RelatedExecuteInformationEntity> relatedExecuteInformation) {
        this.relatedExecuteInformation = relatedExecuteInformation;
    }

    public String getLoopType() {
        return loopType;
    }

    public void setLoopType(String loopType) {
        this.loopType = loopType;
    }

    public Integer getReserveSize() {
        return reserveSize;
    }

    public void setReserveSize(Integer reserveSize) {
        this.reserveSize = reserveSize;
    }

    public String getBackupDealType() {
        return backupDealType;
    }

    public void setBackupDealType(String backupDealType) {
        this.backupDealType = backupDealType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
